package com.cqc.recyclyviewitemanimation01.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.cqc.recyclyviewitemanimation01.R;
import com.cqc.recyclyviewitemanimation01.adapter.RecyclerViewGridAdapter;

/**
 * Created by ${cqc} on 2017/9/25.
 *
 */

public class RecyclerViewGridLayoutAnimationActivity2 extends AppCompatActivity {

    private RecyclerView recyclerView;
    private Context context = this;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler_view_grid_layout_animation_2);
        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new GridLayoutManager(context, 3));
//        LayoutAnimationController loadLayoutAnimation = AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_slide_in_right);
//        LayoutAnimationController loadLayoutAnimation = AnimationUtils.loadLayoutAnimation(context, R.anim.grid_layout_animation);
//        recyclerView.setLayoutAnimation(loadLayoutAnimation);

        RecyclerViewGridAdapter adapter = new RecyclerViewGridAdapter();
        recyclerView.setAdapter(adapter);
    }
}
